Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

490
Views
mongo: failed to connect to server [localhost:27017]

happened to someone?

what can I do to solve this problem? I'm on windows so I can't run sudo mongo I tried to do "runas" in windows instead of linux "sudo" but it didn;t help me out. I was looking for a fle called monogod.lock to remove it but didn't find something like that...I tried mongo repair but it also didn't help me...help someone?

btw...I tried to start mongo.exe from it's directory in another CMD but it failed also: enter image description here

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Seems you have not started the Mongo DB Server. Do the followings.

  1. In Windows, start Command Prompt.
  2. Run mongod.exe to start Mongo DB Server.(This will work only if your environment variable PATH contains the bin directory of your Mongo DB installation)
  3. Open another Command Prompt and start client by running mongo.exe.

Check this link which might help you.

MongoError: failed to connect to server [localhost:27017] on first connect

over 4 years ago · Santiago Trujillo Report

0

oh guys I finally got that! when you run mongod.exe on windows you should also give it the path of the directory if not it won't work! if somehow you'll have a mongod.lock on your directory you should delete this file than write on CMD mongod.exe repair and start running it again! thanks to all =]

over 4 years ago · Santiago Trujillo Report

0

In linux

1.- In the terminal

$ sudo systemctl start mongodb

$ mongo

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!